import { lazy } from 'react'
import { Redirect } from 'react-router-dom'
import Find from '@/pages/find'
import Home from '@/home'
const My = lazy(() => import('../pages/my'))
const TopList = lazy(() => import('../pages/topList'))
const SheetPage = lazy(() => import('../pages/SheetPage'))
const SingerPage = lazy(() => import('../pages/SingerPage'))
const SearchPage = lazy(() => import('../pages/SearchPage'))
const AlbumPage = lazy(() => import('../pages/AlbumPage'))
const PlayListsPage = lazy(() => import('../pages/PlayListsPage'))
const HistoryPage = lazy(() => import('../pages/HistoryPage'))
const ArtistsPage = lazy(() => import('../pages/ArtistsPage'))
const MVPage = lazy(() => import('../pages/MVPage'))








const routes = [
    {
        path: '/',
        exact: true,
        render: () => <Redirect to="/home" />,
    },
    {
        path: '/home',
        component: Home,
        routes: [
            {
                path: '/home',
                exact: true,
                render: () => <Redirect to="/home/find" />,
            },
            {
                path: '/home/find',
                component: Find
            },
            {
                path: '/home/my',
                component: My
            },
            {
                path: '/home/toplist',
                component: TopList
            },
            {
                path: '/home/search',
                component: SearchPage
            },
        ]
    },
    {
        path: '/sheet/:id',
        component: SheetPage
    },
    {
        path: '/history',

        component: HistoryPage
    },
    {
        path: '/mv/:id',
        component: MVPage
    },
    {
        path: '/artists',
        component: ArtistsPage
    },
    {
        path: '/playlists',
        component: PlayListsPage
    },
    {
        path: '/album/:id',
        component: AlbumPage
    },
    {
        path: '/singer/:id',
        component: SingerPage
    },

]
export default routes